package com.nothing.count.controller;

import com.nothing.count.service.CountService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/*
* 数据统计模块
* */
@RequestMapping("/count")
@Controller
public class CountController {
    @Resource
    CountService countService;

    //员工薪资页面
    @RequestMapping(value = "/empSal" , method = RequestMethod.GET)
    public String empSal(){
        return "/count/empSal";
    }

    //员工薪资数据
    @ResponseBody
    @RequestMapping(value = "/empSal" , method = RequestMethod.POST)
    public List empSalData(){
        //直接查询要统计的数据
        return countService.countEmpSal();
    }

    //部门总薪资页面
    @RequestMapping(value = "/deptSal" , method = RequestMethod.GET)
    public String deptSal(){
        return "/count/deptSal";
    }

    //部门总薪资数据
    @ResponseBody
    @RequestMapping(value = "/deptSal" , method = RequestMethod.POST)
    public List deptSalData(){
        //直接查询要统计的数据
        return countService.countDeptSal();
    }

    //部门人数页面
    @RequestMapping(value = "/deptNum" , method = RequestMethod.GET)
    public String deptNum(){
        return "/count/deptNum";
    }

    //部门人数数据
    @ResponseBody
    @RequestMapping(value = "/deptNum" , method = RequestMethod.POST)
    public List deptNumData(){
        //直接查询要统计的数据
        return countService.countDeptNum();
    }
}
